package com.cckat.controller;

import com.cckat.entity.Dict;
import com.cckat.result.Result;
import com.cckat.service.DictService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 静海基地
 */
//@ResponseBody的作用其实是将java对象转为json格式的数据。
@RestController//@controller+@ResponseBody
@RequestMapping("/dict")
public class DictController {

    @DubboReference
    private DictService dictService;

    @RequestMapping("findDictListByParentDictCode/{dictCode}")
    public Result findDictListByParentDictCode(@PathVariable String dictCode){
        List<Dict> dictList = dictService.findDictListByParentDictCode(dictCode);
        return Result.ok(dictList);


    }
}
